/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.util.convertor;

import info.peigen.hotpot.manage.core.domain.Organization;
import info.peigen.hotpot.manage.core.repository.entity.OrganizationEntity;
import info.peigen.hotpot.manage.core.service.order.OrganizationCreateOrder;
import info.peigen.hotpot.manage.core.service.order.OrganizationEditOrder;
import info.peigen.hotpot.manage.core.service.result.info.OrganizationInfo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <b>(OrganizationConvertor)</b>
 * "组织机构" 转换器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-06-28
 */
@SuppressWarnings("unused")
@Mapper(builder = @Builder(disableBuilder = true))
public interface OrganizationConvertor {
    OrganizationConvertor INSTANCE = Mappers.getMapper(OrganizationConvertor.class);

    // ConvertToEntity
    OrganizationEntity convertToEntity(Organization domain);
    List<OrganizationEntity> convertToEntitiesByDomain(List<Organization> domains);

    OrganizationEntity convertToEntity(OrganizationInfo organizationInfo);
    List<OrganizationEntity> convertToEntitiesByInfo(List<OrganizationInfo> organizationInfo);

    // ConvertToDomain
    Organization convertToDomain(OrganizationEntity entity);
    List<Organization> convertToDomainsByEntity(List<OrganizationEntity> entities);
    Organization convertToDomain(OrganizationInfo organizationInfo);
    List<Organization> convertToDomainsByInfo(List<OrganizationInfo> infos);

    Organization convertToDomain(OrganizationCreateOrder order);
    Organization convertToDomain(OrganizationEditOrder order);

    // ConvertToInfo
    OrganizationInfo convertToInfo(Organization domain);
    List<OrganizationInfo> convertToInfosByDomain(List<Organization> domains);

    OrganizationInfo convertToInfo(OrganizationEntity entity);
    List<OrganizationInfo> convertToInfosByEntity(List<OrganizationEntity> entities);
}